#include "qgadu.h"
#include "ui_qgadu.h"
#include "gadu.h"

gadu gg; // Nowy obiekt gg klasy gadu

QGadu::QGadu(QWidget *parent)
    : QMainWindow(parent), ui(new Ui::QGadu)
{
    gg.connect(1234567,"haslo");
    ui->setupUi(this);
}

QGadu::~QGadu()
{
    gg.disconnect();
    delete ui;
}

void QGadu::on_sendButton_clicked()
{
    QString original_msg = ui->writeEdit->toPlainText();
    unsigned char *msg = NULL;
    msg = (unsigned char*)qstrdup(original_msg.toLatin1().constData());
    gg.send(1234567,msg);
    ui->convEdit->append("<u>20.03.2009 :: <b>Blob</b></u>");
    ui->convEdit->append(ui->writeEdit->toPlainText());
    ui->writeEdit->clear();
}

void QGadu::on_clearButton_clicked()
{
    ui->convEdit->clear();
    ui->writeEdit->clear();
}
